<template>
  <div class="main_box" style="padding:10px">
    <div class="detail_wrap">
      <div class="tit">
        <h2>医 检 子 项 目 信 息</h2>
        <el-button
          type="success"
          plain
          size="small"
          icon="fa fa-mail-forward"
          @click="returnList"
        >
          返回</el-button
        >
      </div>
      <div class="con">
        <ul>
          <li>
            <label class="label">子项目编号:</label>
            <span>{{ dataInfo.subItemCode }}</span>
          </li>
          <li>
            <label class="label">子项目名称:</label>
            <span>{{ dataInfo.subItemName }}</span>
          </li>
          <li>
            <label class="label">子项目别称:</label>
            <span>{{ dataInfo.subItemShortName }}</span>
          </li>
          <li>
            <label class="label">医检名称:</label>
            <span>{{ dataInfo.institutionName }}</span>
          </li>
          <li>
            <label class="label">对应康来子项目编号:</label>
            <span>{{ dataInfo.reportSubItemCode }}</span>
          </li>
          <li>
            <label class="label">对应康来子项目名称:</label>
            <span>{{ dataInfo.reportSubItemName | filtersOther }}</span>
          </li>
          <li>
            <label class="label">专业分组编号:</label>
            <span>{{ dataInfo.subItemGroupCode }}</span>
          </li>
          <li>
            <label class="label">专业分组:</label>
            <span>{{ dataInfo.subItemGroup | filtersOther }}</span>
          </li>
          <li>
            <label class="label">原价格:</label>
            <span>{{ dataInfo.subItemPrice | filterPrice }}</span>
          </li>
          <li>
            <label class="label">合作价格:</label>
            <span>{{ dataInfo.subItemSalePrice | filterPrice }}</span>
          </li>
          <li>
            <label class="label">创建人名称:</label>
            <span>{{ dataInfo.createUserName }}</span>
          </li>
          <li>
            <label class="label">创建时间:</label>
            <span>{{ dataInfo.createDate }}</span>
          </li>
        </ul>
      </div>
      <div class="tit">
        <h2>关 联 医 检 项 目 组 列 表</h2>
      </div>
      <el-table
        :data="tableData"
        highlight-current-row
        :header-row-style="{'background-color':'#f2f2f2'}"
        style="width: min-content;margin: 20px 0;">
        <el-table-column
          type="index"
          width="80px"
          align="center"
          label="序号">

        </el-table-column>
        <el-table-column
          prop="itemId"
          label="项目组ID"
          width="180"
          align="center">
        </el-table-column>
        <el-table-column
          prop="itemCode"
          label="项目组编号"
          width="180"
          align="center">

        </el-table-column>
        <el-table-column
          prop="itemName"
          label="项目组名称"
          width="300"
          align="center">

        </el-table-column>
        <el-table-column
          prop="itemShortName"
          label="项目组别称"
          width="180"
          align="center">

        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import InstitutionItemApi from "@/api/institution/institutionItem";
export default {
  data() {
    return {
      dataInfo: {},
       tableData: []
    };
  },
  methods: {
    getData() {
      InstitutionItemApi.getInstitutionSubItem({
        itemId: this.$route.query.id
      }).then(res => {
        this.dataInfo = res.data;
        this.tableData = res.data.institutionItems
      });
    },
    returnList() {
      // this.$router.go(-1)
      this.$store.dispatch("delView", this.$route);
      this.$router.push({ path: "/item/institutionSubItemManagement" });
    }
  },
  mounted() {
    this.getData();
  },
  filters: {
    //   过滤器
    filterPrice(value) {
      if (value) {
        return value + "元";
      } else {
        return "未知";
      }
    },
    filtersOther(val) {
      if (val) {
        return val;
      } else {
        return "未知";
      }
    }
  }
};
</script>
<style lang="scss" src="@/assets/css/views/Detail.scss" scope></style>
